import path from "path";
import Config from "./components/Config.js";

const _path = process.cwd() + "/plugins/js-box-plugin";

export function supportGuoba() {
  return {
    pluginInfo: {
      name: 'js-box-plugin',
      title: '沙盒插件',
      author: '@角叶',
      authorLink: 'https://gitee.com/yuheng_233',
      link: 'https://gitee.com/yuheng_233',
      isV3: true,
      isV2: false,
      description: '这里什么都没有，插件链接随便挂的，根本没有项目',
      iconPath: path.join(_path, "resources/Guoba-imgs/Android.jpg"),
    },
    // 配置项信息
    configInfo: {
      // 配置项 schemas
      schemas: [{
        field: 'huagao',
        label: '花糕',
        bottomHelpMessage: '花糕插件',
        component: 'Switch'
      },{
        field: 'cmd',
        label: '终端',
        bottomHelpMessage: '执行Linux终端命令',
        component: 'Switch'
      },{
        field: 'map',
        label: '地图',
        bottomHelpMessage: '须弥地图总览',
        component: 'Switch'
      },{
        field: 'zhenxunchuo',
        label: '戳一戳真改',
        bottomHelpMessage: '来自@癫癫博士',
        component: 'Switch'
      },{
        field: 'sleep',
        label: '真寻休息',
        bottomHelpMessage: '真寻休息高仿',
        component: 'Switch'
      },{
        field: 'carp',
        label: '话痨统计',
        bottomHelpMessage: '查水群成分',
        component: 'Switch'
      },{
        field: 'whoatme',
        label: '谁艾特我',
        bottomHelpMessage: '看看谁艾特我',
        component: 'Switch'
      },{
        field: 'remor',
        label: '伪造消息',
        bottomHelpMessage: '真的不是我说的！',
        component: 'Switch'
      },{
        field: 'panelbg',
        label: '上传面板图',
        helpMessage: '开启后默认覆盖喵喵上传面板图',
        bottomHelpMessage: '喵喵面板图管理',
        component: 'Switch'
      },{
        field: 'callme',
        label: '我的新昵称',
        helpMessage: '让Bot给你换个称呼',
        bottomHelpMessage: '来自@冰祈',
        component: 'Switch'
      },{
        field: 'manager',
        label: '插件管理器',
        bottomHelpMessage: '来自@戏天',
        component: 'Switch'
      },{
        field: 'txtone',
        label: '文本回复一',
        bottomHelpMessage: '词库文本回复',
        component: 'Switch'
      },{
        field: 'txttwo',
        label: '文本回复二',
        bottomHelpMessage: '词库文本回复',
        component: 'Switch'
      },{
        field: 'genshintime',
        label: '原神注册时间',
        bottomHelpMessage: '看看我的入坑日',
        component: 'Switch'
      }],

      getConfigData () {
        return Config.pluginset
      },
      setConfigData (data, { Result }) {
        for (let [keyPath, value] of Object.entries(data)) {
          Config.modify("admin_set", keyPath, value)
        }
        return Result.ok({}, 'Done.')
      }
    }
  }
}